import logo from './logo.svg';
import './App.css';
import * as XLSX from 'xlsx';
import * as CONCAT from "concat-stream";
import * as buffer from "buffer";
import * as jsonx from "jsonx";
import {useEffect, useState} from "react";
import Democonp from "./conpoments/democonp";


function App() {
  const [LB,setLB]=useState({
    component:'div',
    props: {
      title: 'jsonx',
    },
    children: 'hello',
  })
  const [count,setCount]=useState(1)
const JXM = {
  component:'div',
  props: {
    title: 'jsonx',
  },
  children: 'hello',
}


  

  useEffect(()=>{
    console.log("run");
    jsonx.jsonxRender({
      jsonx:LB,
      querySelector:'#main'
    })
  },[count])
  let arr=[]
  const [array,setArray]=useState([])
  return( <div   >
    <button onClick={()=>{
      let Ob=LB

      setArray(arr.push(2))
      Ob.children=arr
      console.log(Ob);
      console.log('lb',LB);
      setLB(Ob)
      setCount(count+1)
    }}>加一 行</button>
    <div id={'main'}></div>


  </div>)
}

export default App;

